{% extends "base.html" %}
{% load static %}

{% block title %}PM项目管理{% endblock %}

{# 应用级侧边栏 #}
{% block app_sidebar %}
<nav class="col-md-3 col-lg-2 d-md-block app-sidebar">
    <div class="position-sticky pt-3">
        <div class="sidebar-header p-3">
            <h6 class="text-muted text-uppercase">
                <i class="fas fa-project-diagram me-2"></i>PM项目管理
            </h6>
        </div>
        
        <ul class="nav flex-column">
            <li class="nav-item">
                <a class="nav-link {% if request.resolver_match.url_name == 'index' %}active{% endif %}" 
                   href="/pm/index/">
                    <i class="fas fa-home me-2"></i>PM首页
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link {% if 'report' in request.resolver_match.url_name %}active{% endif %}" 
                   href="/pm/report_list/">
                    <i class="fas fa-chart-bar me-2"></i>报告管理
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link {% if 'analysis' in request.resolver_match.url_name %}active{% endif %}" 
                   href="/pm/analysis/">
                    <i class="fas fa-analytics me-2"></i>数据分析
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link {% if 'export' in request.resolver_match.url_name %}active{% endif %}" 
                   href="/pm/export/">
                    <i class="fas fa-download me-2"></i>数据导出
                </a>
            </li>
        </ul>
        
        <hr class="my-3">
        
        <div class="px-3">
            <h6 class="text-muted text-uppercase small">快速操作</h6>
            <div class="d-grid gap-2">
                <a href="/pm/report_add/" class="btn btn-primary btn-sm">
                    <i class="fas fa-plus me-1"></i>新建报告
                </a>
                <a href="/pm/export/" class="btn btn-outline-secondary btn-sm">
                    <i class="fas fa-file-export me-1"></i>导出数据
                </a>
            </div>
        </div>
    </div>
</nav>
{% endblock %}

{# 调整主内容区域宽度 #}
{% block main_class %}col-md-9 ms-sm-auto col-lg-10{% endblock %}

{# 面包屑导航 #}
{% block breadcrumb_items %}
<li class="breadcrumb-item"><a href="/pm/index/">PM系统</a></li>
{% block pm_breadcrumb %}{% endblock %}
{% endblock %}

{# 额外的PM应用CSS #}
{% block extra_css %}
{{ block.super }}
<style>
.sidebar-header {
    border-bottom: 1px solid #dee2e6;
}

.app-sidebar .nav-link.active {
    font-weight: 600;
    border-left: 3px solid #0d6efd;
}

.quick-actions {
    position: sticky;
    bottom: 20px;
}
</style>
{% endblock %}